<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
    <!-- Use Chrome Frame in IE -->
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
    <meta name="description" content="Adjust the height of a 3D Tiles tileset." />
    <meta name="cesium-sandcastle-labels" content="3D Tiles" />
    <title>箱式变压器</title>
    <script type="text/javascript" src="../Sandcastle-header.js"></script>
    <script type="text/javascript" src="../../../Build/CesiumUnminified/Cesium.js" nomodule></script>
    <script type="module" src="../load-cesium-es6.js"></script>
</head>

<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html">
<style>
    @import url(../templates/bucket.css);

    #toolbar {
        background: rgba(42, 42, 42, 0.8);
        padding: 4px;
        border-radius: 4px;
    }

    #toolbar input {
        vertical-align: middle;
        padding-top: 2px;
        padding-bottom: 2px;
    }
</style>
<div id="cesiumContainer" class="fullSize"></div>
<div id="loadingOverlay">
    <h1>初始化中...</h1>
</div>
<div id="toolbar">
    <div>Height</div>
    <input type="range" min="-100.0" max="100.0" step="1" data-bind="value: height, valueUpdate: 'input'" />
    <input id="heightInput" type="text" size="5" data-bind="value: height" />
</div>
<script id="cesium_sandcastle_script">
    window.startup = function (Cesium) {
        "use strict";
        //Sandcastle_Begin
        const viewer = new Cesium.Viewer("cesiumContainer", {
            //上方组件
            //geocoder:false,//搜索组件
            homeButton:false,//首页位置，可跳转到默认视角
            sceneModePicker:false,//场景模式切换（2d,3d)
            baseLayerPicker:false,//图层选择器
            navigationHelpButton:false,//帮助提示（小问号）
            //下方组件
            animation:false,//动画组件
            timeline:false,//时间轴

            //载入地图资产
            terrainProvider: new Cesium.CesiumTerrainProvider({
                url: Cesium.IonResource.fromAssetId(3957),
                requsestVertexNormal:true,
                requestWaterMask:true
            })
        });

        viewer._cesiumWidget._creditContainer.style.display = "none";

        var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
        url: '../../modelTiles/tileset.json',
        modelMatrix: Cesium.Matrix4.fromArray(
            [0.9755001094965393,-0.20789132601288046,0.07197730851349152,0,0.21645376823584112,0.9654571075455294,-0.1450528858945047,0,-0.03933576729574466,0.15707886572809704,0.9868023750239097,0,-489.89767403830774,1956.3002389864996,3887.081720088143,1]),
    }));

    viewer.flyTo(tileset);
        
        //Sandcastle_End
        Sandcastle.finishedLoading();
    };
    if (typeof Cesium !== "undefined") {
        window.startupCalled = true;
        window.startup(Cesium);
    }

</script>
</body>

</html>